package com.example.administrator.printoutindemo.base;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;

import com.dds.soap.SoapUtil;
import com.jess.arms.base.ArmsBaseConstants;
import com.jess.arms.base.BaseConstants;
import com.jess.arms.utils.SharedPreferencesHelper;


/**
 * @author 小星 QQ:753940262
 * @class describe
 * @time 2019/9/11 0011 8:51
 */
public class BaseFragment extends Fragment {
    protected SharedPreferencesHelper mSharedPreferencesHelper;
    protected SoapUtil soapUtil;


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mSharedPreferencesHelper = SharedPreferencesHelper.getInstance(getActivity());
        soapUtil = SoapUtil.getInstance(getActivity());
        soapUtil.setDotNet(true);

    }

    @NonNull
    protected String getUrl() {
        return "http://" + mSharedPreferencesHelper.getString(ArmsBaseConstants.IP) + ":"
                + mSharedPreferencesHelper.getString(ArmsBaseConstants.PORT)
                + "/StoreService.asmx";
    }

    public Context getContext() {
        return getActivity();
    }

    protected String getAapiUserName() {
        return mSharedPreferencesHelper.getString(BaseConstants.API_USER_NAME);
    }

    protected String getApiPwd() {
        return mSharedPreferencesHelper.getString(BaseConstants.API_PWD);
    }

}
